#include <stdio.h>
#include <conio.h>

int menu( int elect);
void BMI(void);
void normal(void);
void test( float *bmi);

int main(void) {
	int elect ;
	char ans;
	
	startover :
		
	
	
	switch ( menu(elect) ) {
		case 1 :
			BMI();
			break;
		case 2 :
			normal();
			break;	
	}
	
	printf("would you like to startover ? Y/N\n");
	scanf(" %c", &ans);
	if ( ans == 'Y' || ans == 'y')
		goto startover;
		
	getchar();
	return 0;	
}

int menu( int elect) {
	int a ;
	printf("1- cal BMI\n");
	printf("2- view normal range\n");
	scanf("%d", &a);
	
	return a;
}

void BMI(void) {
	
	int weight , Hight ;
	float hight ;
	float bmi ;
	printf("enter your weight and hight : \n");
	scanf("%d %d", &weight , &Hight);
	hight = (float) Hight / 100;
	bmi =  weight / (hight*hight);
	
	
	printf("your BMI is %.2f and you are ", bmi);
	
	test(&bmi);
	
}

void test( float *bmi ) {
	
	if ( *bmi >= 19 && *bmi <= 25 ) {
		printf("\t in good shape\n");
	} else
			 if ( *bmi <= 19 ) {
				printf("\t skinny , you better to eat sometimes\n");
		
				} 	else printf("\t useless fat being thing \n");
	
		
	
}

void normal(void) {
	
	printf(" BMI normal range are 19 - 25\n");
}
